﻿using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

namespace Elvex
{
    public class EXButton : Button
    {
        [SerializeField]
        AudioClip m_audioClip;

        public AudioClip AudioClip { 
            get {
                return m_audioClip;
            }
            set {
                m_audioClip = value;
            } }

        public override void OnPointerClick(PointerEventData eventData)
        {
            base.OnPointerClick(eventData);
            //if( null != AudioClip)
            //{
            //    if( null == m_audioSource )
            //    {
            //        m_audioSource = AudioManager.Instance.AddSoundSource(AudioClip);
            //    }
            //    m_audioSource.Play();
            //}
        }

        protected override void OnDestroy()
        {
            //if(null != m_audioSource)
            //{
            //    AudioManager.Instance.RemoveAudioSource(m_audioSource);
            //}
        }
    }
}
